package com.jstorm.count.mapper.commonroad;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @ProjectName: common
 * @Package: com.jstorm.count.mapper.network
 * @ClassName: NetworkMapper
 * @Description:
 * @Author: Mr_hu
 * @CreateDate: 2018/12/28 18:34
 * ***********************************************************
 * @UpdateUser: Mr_hu
 * @UpdateDate: 2018/12/28 18:34
 * @UpdateRemark: The modified content
 * @Version: 1.0
 * ***********************************************************
 * Copyright: Copyright (c) 2018
 **/
@Mapper
public interface CommonroadMapper {

    /**
     * 查询数量
     * @return
     */
 @Select( "select * from (select table_name as metadataName  ,num_rows as metadataCount  from all_tables WHERE table_name LIKE  '%T_WB%' ORDer by           num_rows desc) \n" +
         "where metadataName='T_WB_ANALOGACQUISITION' or metadataName='T_WB_CARRIERSPY'or metadataName='T_WB_CARRIERSTAT'or                                  metadataName='T_WB_MAINBOARD' or metadataName='T_WB_SIGNALNOISERATIO' or metadataName='T_WB_SPECTRUM'or metadataName='T_WB_SPECTRUMFILE'")
    List<Map<String, Object>>  selectCommonroadCount();

    /**
     * 查询总数
     * @return
     */
    @Select("select sum(metadataCount) as total_count,'共路信令特征采集服务' as Total_name  from (select table_name as metadataName  ,num_rows as  metadataCount  from all_tables WHERE table_name LIKE  '%T_WB%' ORDer by num_rows desc) \n" +
            "where metadataName='T_WB_ANALOGACQUISITION' or metadataName='T_WB_CARRIERSPY'or metadataName='T_WB_CARRIERSTAT'or metadataName='T_WB_MAINBOARD'\n" +
            "    or metadataName='T_WB_SIGNALNOISERATIO' or metadataName='T_WB_SPECTRUM'or metadataName='T_WB_SPECTRUMFILE'")
    List<Map<String, Object>>   selectCommonroadTotal();



    /**
     * 查询整个用户表下所有数量
     * @return
     */
    @Select("SELECT COUNT(*) as sums FROM USER_TABLES")
    List<Object>   selectCommonroadSums();


}
